"""
celery的配置文件：名字必须为celery.py
和setting.py同路径
"""
import os
from celery import Celery
from dashopt import settings

# 1.设置临时环境变量
os.environ.setdefault('DJANGO_SETTINGS_MODULE',
                      'dashopt.settings')

# 2.初始化celery的应用
app = Celery("dashop_project",
             broker="redis://127.0.0.1:6379/15")


# 3.设置自动发送任务
app.autodiscover_tasks(settings.INSTALLED_APPS)
